package dy

import (
	"context"
	v1 "dy_spider/api/dy/v1"
	"dy_spider/internal/dao"
)

func (s *sDy) PostUser(ctx context.Context, req *v1.PostUserReq) (res *v1.PostUserRes, err error) {
	data := map[string]string{
		"user_id":      req.UserId,
		"short_id":     req.ShortId,
		"nick_name":    req.NickName,
		"gender":       req.Gender,
		"avatar_thumb": req.AvatarThumb,
		"pay_level":    req.PayLevel,
		"follower":     req.Follower,
		"following":    req.Following,
	}
	_, err = dao.DyUser.Ctx(ctx).Save(data)
	if err != nil {
		return nil, err
	}
	return res, nil
}
